<template>
    <div class="recommend">
        <div class="title">热销推荐</div>
        <ul>
            <router-link tag="li" :to="'/detail/'+item.id" class="item border-bottom" v-for="item in recommendList" :key="item.id">
                <div class="imgBox"><img :src="item.imgUrl" :alt="item.title"></div>
                <div class="content">
                    <p class="textEllipsis">{{item.title}}</p>
                    <p class="textEllipsis">{{item.desc}}</p>
                    <div class="button">查看详情</div>
                </div>
            </router-link>
        </ul>
    </div>
</template>

<style scoped>
.recommend{
    width: 100%;
}
.title{
    box-sizing: border-box;
    padding: .2rem;
    background-color: #a7a7a7;
    color: white;
}
.item{
    display: flex;
    box-sizing: border-box;
    padding: .2rem;
}
.item .imgBox{
    width: 2rem;
    height: 1.5rem;
}
.imgBox img{
    width: 100%;
    height: 100%;
}
.item .content{
    flex: 1;
    margin-left: .2rem;
    min-width: 0;
    position: relative;
}
.content>p:nth-child(1){
    margin-top: .1rem;
    font-size: .35rem;
}
.content>p:nth-child(2){
    font-size: .3rem;
    margin-top: .1rem;
    color: gray;
}
.content .button{
    display: inline-block;
    background-color: orange;
    color: white;
    padding: .1rem .2rem;
    border-radius: .1rem;
    position: absolute;
    bottom: .1rem;
}
</style>

<script>
export default {
    name:"commponend",
    props:['recommendList'],
    data(){
        return{
            title:"推荐",
        }
    }
}
</script>

